/**
 * Created by Baggio on 2017-8-16.
 */
$(function(){
    $("#advertSubmit").click(function () {
        var postUrl = ctx + '/scoreMall/getscoreMallSubmit';
        var postData = $('#form-member-add').serialize();


        $("#form-member-add").ajaxSubmit({
            type: 'POST',
            data: postData,
            url: postUrl,
            success: function (data) {
                console.log(data);
                if (data.code != 1) {
                    layer.msg(data.msg, {icon: 5, time: 1000});
                    console.log(data.msg);
                    return;
                }
                layer.msg('操作成功!', {icon: 6, time: 1000}, function () {
                    window.parent.location.reload();
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index);
                })
            }

        });



    })
});